WPS Office.apk(点击下载) / aadi.java


package defpackage;

import android.support.v4.media.session.PlaybackStateCompat;
import cn.wps.shareplay.message.Message;
import com.mopub.nativeads.MoPubNativeAdPositioning;
import java.io.IOException;
import java.io.PrintStream;

/* renamed from: aadi  reason: default package */
public final class aadi implements aadh {
    static int BSK;
    static final long[] BSM = {0, 0, -1, -1};
    static final int[] BSN = new int[0];
    public static final String[] BSO = {"", "\r", "\n", Message.SEPARATE, "Mon", "Tue", "Wed", "Thu", "Fri", "Sat", "Sun", "Jan", "Feb", "Mar", "Apr", "May", "Jun", "Jul", "Aug", "Sep", "Oct", "Nov", "Dec", Message.SEPARATE2, null, "UT", "GMT", "EST", "EDT", "CST", "CDT", "MST", "MDT", "PST", "PDT", null, null, null, null, null, null, null, null, null, null, null, null, null, null};
    public static final String[] BSP = {"DEFAULT", "INCOMMENT", "NESTED_COMMENT"};
    public static final int[] BSQ = {-1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, 1, 0, -1, 2, -1, -1, -1, -1, -1, -1, -1, -1};
    static final long[] BSR = {70437463654399L};
    static final long[] BSS = {343597383680L};
    static final long[] BST = {68719476736L};
    static final long[] BSU = {69956427317248L};
    public PrintStream BSL;
    private final int[] BSW;
    private final int[] BSX;
    StringBuffer BSY;
    int BSZ;
    protected aadk BTR;
    int BTa;
    protected char BTb;
    int BTc;
    int BTd;
    int BTe;
    int BTf;
    int BTg;
    int BTh;

    public aadi(aadk aadk) {
        this.BSL = System.out;
        this.BSW = new int[4];
        this.BSX = new int[8];
        this.BTc = 0;
        this.BTd = 0;
        this.BTR = aadk;
    }

    public aadi(aadk aadk, int i) {
        this(aadk);
        axq(i);
    }

    private final int B(int i, long j) {
        switch (i) {
            case 0:
                if ((34334373872L & j) != 0) {
                    this.BTh = 35;
                    break;
                }
                break;
            case 1:
                if ((34334373872L & j) != 0 && this.BTg == 0) {
                    this.BTh = 35;
                    this.BTg = 0;
                    break;
                }
        }
        return -1;
    }

    private final int C(int i, long j) {
        return nv(B(i, j), i + 1);
    }

    private final int F(long j, long j2) {
        long j3 = j2 & j;
        if (j3 == 0) {
            return C(0, j);
        }
        try {
            this.BTb = this.BTR.readChar();
            switch (this.BTb) {
                case 'T':
                    if ((67108864 & j3) != 0) {
                        return nu(2, 26);
                    }
                    if ((134217728 & j3) != 0) {
                        return nu(2, 27);
                    }
                    if ((268435456 & j3) != 0) {
                        return nu(2, 28);
                    }
                    if ((536870912 & j3) != 0) {
                        return nu(2, 29);
                    }
                    if ((1073741824 & j3) != 0) {
                        return nu(2, 30);
                    }
                    if ((2147483648L & j3) != 0) {
                        return nu(2, 31);
                    }
                    if ((4294967296L & j3) != 0) {
                        return nu(2, 32);
                    }
                    if ((8589934592L & j3) != 0) {
                        return nu(2, 33);
                    }
                    if ((17179869184L & j3) != 0) {
                        return nu(2, 34);
                    }
                    break;
                case 'b':
                    if ((4096 & j3) != 0) {
                        return nu(2, 12);
                    }
                    break;
                case 'c':
                    if ((4194304 & j3) != 0) {
                        return nu(2, 22);
                    }
                    break;
                case 'd':
                    if ((64 & j3) != 0) {
                        return nu(2, 6);
                    }
                    break;
                case 'e':
                    if ((32 & j3) != 0) {
                        return nu(2, 5);
                    }
                    break;
                case 'g':
                    if ((PlaybackStateCompat.ACTION_SET_REPEAT_MODE & j3) != 0) {
                        return nu(2, 18);
                    }
                    break;
                case 'i':
                    if ((256 & j3) != 0) {
                        return nu(2, 8);
                    }
                    break;
                case 'l':
                    if ((PlaybackStateCompat.ACTION_PREPARE_FROM_URI & j3) != 0) {
                        return nu(2, 17);
                    }
                    break;
                case 'n':
                    if ((16 & j3) != 0) {
                        return nu(2, 4);
                    }
                    if ((1024 & j3) != 0) {
                        return nu(2, 10);
                    }
                    if ((2048 & j3) != 0) {
                        return nu(2, 11);
                    }
                    if ((PlaybackStateCompat.ACTION_PREPARE_FROM_SEARCH & j3) != 0) {
                        return nu(2, 16);
                    }
                    break;
                case 'p':
                    if ((PlaybackStateCompat.ACTION_SET_SHUFFLE_MODE_ENABLED & j3) != 0) {
                        return nu(2, 19);
                    }
                    break;
                case 'r':
                    if ((PlaybackStateCompat.ACTION_PLAY_FROM_URI & j3) != 0) {
                        return nu(2, 13);
                    }
                    if ((PlaybackStateCompat.ACTION_PREPARE & j3) != 0) {
                        return nu(2, 14);
                    }
                    break;
                case 't':
                    if ((512 & j3) != 0) {
                        return nu(2, 9);
                    }
                    if ((PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED & j3) != 0) {
                        return nu(2, 20);
                    }
                    break;
                case 'u':
                    if ((128 & j3) != 0) {
                        return nu(2, 7);
                    }
                    break;
                case 'v':
                    if ((PlaybackStateCompat.ACTION_SET_SHUFFLE_MODE & j3) != 0) {
                        return nu(2, 21);
                    }
                    break;
                case 'y':
                    if ((PlaybackStateCompat.ACTION_PREPARE_FROM_MEDIA_ID & j3) != 0) {
                        return nu(2, 15);
                    }
                    break;
            }
            return C(1, j3);
        } catch (IOException e) {
            B(1, j3);
            return 2;
        }
    }

    private final void axp(int i) {
        if (this.BSW[i] != this.BTf) {
            int[] iArr = this.BSX;
            int i2 = this.BTe;
            this.BTe = i2 + 1;
            iArr[i2] = i;
            this.BSW[i] = this.BTf;
        }
    }

    private void axq(int i) {
        if (i >= 3 || i < 0) {
            throw new aadm("Error: Ignoring invalid lexical state : " + i + ". State unchanged.", 2);
        }
        this.BTc = i;
    }

    /* JADX INFO: Can't fix incorrect switch cases order, some code will duplicate */
    private final int eA(long j) {
        try {
            this.BTb = this.BTR.readChar();
            switch (this.BTb) {
                case 'D':
                    return F(j, 22817013760L);
                case 'M':
                    return F(j, 67108864);
                case 'S':
                    return F(j, 11408506880L);
                case 'T':
                    if ((33554432 & j) != 0) {
                        return nu(1, 25);
                    }
                    break;
                case 'a':
                    return F(j, 43520);
                case 'c':
                    return F(j, PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED);
                case 'e':
                    return F(j, 4722752);
                case 'h':
                    return F(j, 128);
                case 'o':
                    return F(j, 2097168);
                case 'p':
                    return F(j, PlaybackStateCompat.ACTION_PREPARE);
                case 'r':
                    return F(j, 256);
                case 'u':
                    return F(j, 459808);
            }
            return C(0, j);
        } catch (IOException e) {
            B(0, j);
            return 1;
        }
    }

    private final void gUB() {
        this.BTf = -2147483647;
        int i = 4;
        while (true) {
            int i2 = i - 1;
            if (i > 0) {
                this.BSW[i2] = Integer.MIN_VALUE;
                i = i2;
            } else {
                return;
            }
        }
    }

    private aadl gUL() {
        int i = this.BTh;
        aadl aadl = new aadl();
        aadl.BTv = this.BTh;
        String str = BSO[this.BTh];
        if (str == null) {
            str = this.BTR.gUI();
        }
        aadl.image = str;
        aadl.BTw = this.BTR.gUH();
        aadl.BTx = this.BTR.gUG();
        aadl.BTy = this.BTR.gUF();
        aadl.BTz = this.BTR.gUE();
        return aadl;
    }

    private final int nu(int i, int i2) {
        this.BTh = i2;
        this.BTg = i;
        return i + 1;
    }

    private final int nv(int i, int i2) {
        int i3 = 0;
        this.BTe = 4;
        int i4 = 1;
        this.BSX[0] = i;
        int i5 = Integer.MAX_VALUE;
        while (true) {
            int i6 = this.BTf + 1;
            this.BTf = i6;
            if (i6 == Integer.MAX_VALUE) {
                gUB();
            }
            if (this.BTb < '@') {
                long j = 1 << this.BTb;
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if ((287948901175001088L & j) != 0) {
                                if (i5 > 46) {
                                    i5 = 46;
                                }
                                axp(3);
                                continue;
                            } else if ((4294967808L & j) != 0) {
                                if (i5 > 36) {
                                    i5 = 36;
                                }
                                axp(2);
                                continue;
                            } else if ((43980465111040L & j) != 0 && i5 > 24) {
                                i5 = 24;
                                continue;
                            }
                        case 2:
                            if ((4294967808L & j) != 0) {
                                axp(2);
                                i5 = 36;
                                continue;
                            } else {
                                continue;
                            }
                        case 3:
                            if ((287948901175001088L & j) != 0) {
                                axp(3);
                                i5 = 46;
                                continue;
                            } else {
                                continue;
                            }
                    }
                } while (i4 != i3);
            } else if (this.BTb < 128) {
                long j2 = 1 << (this.BTb & '?');
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if ((576456345801194494L & j2) != 0) {
                                i5 = 35;
                                continue;
                            } else {
                                continue;
                            }
                    }
                } while (i4 != i3);
            }
            if (i5 != Integer.MAX_VALUE) {
                this.BTh = i5;
                this.BTg = i2;
                i5 = Integer.MAX_VALUE;
            }
            i2++;
            i4 = this.BTe;
            this.BTe = i3;
            i3 = 4 - i3;
            if (i4 != i3) {
                try {
                    this.BTb = this.BTR.readChar();
                } catch (IOException e) {
                }
            }
            return i2;
        }
    }

    private final int nw(int i, int i2) {
        int i3 = 0;
        this.BTe = 3;
        int i4 = 1;
        this.BSX[0] = 0;
        int i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
        while (true) {
            int i6 = this.BTf + 1;
            this.BTf = i6;
            if (i6 == Integer.MAX_VALUE) {
                gUB();
            }
            if (this.BTb < '@') {
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if (i5 > 41) {
                                i5 = 41;
                                continue;
                            } else {
                                continue;
                            }
                        case 1:
                            if (i5 > 39) {
                                i5 = 39;
                                continue;
                            } else {
                                continue;
                            }
                    }
                } while (i4 != i3);
            } else if (this.BTb < 128) {
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if (i5 > 41) {
                                i5 = 41;
                            }
                            if (this.BTb == '\\') {
                                int[] iArr = this.BSX;
                                int i7 = this.BTe;
                                this.BTe = i7 + 1;
                                iArr[i7] = 1;
                                continue;
                            } else {
                                continue;
                            }
                        case 1:
                            if (i5 > 39) {
                                i5 = 39;
                                continue;
                            } else {
                                continue;
                            }
                        case 2:
                            if (i5 > 41) {
                                i5 = 41;
                                continue;
                            } else {
                                continue;
                            }
                    }
                } while (i4 != i3);
            } else {
                int i8 = (this.BTb & 255) >> 6;
                long j = 1 << (this.BTb & '?');
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if ((BSM[i8] & j) != 0 && i5 > 41) {
                                i5 = 41;
                                continue;
                            }
                        case 1:
                            if ((BSM[i8] & j) != 0 && i5 > 39) {
                                i5 = 39;
                                continue;
                            }
                    }
                } while (i4 != i3);
            }
            if (i5 != Integer.MAX_VALUE) {
                this.BTh = i5;
                this.BTg = i2;
                i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
            }
            i2++;
            i4 = this.BTe;
            this.BTe = i3;
            i3 = 3 - i3;
            if (i4 != i3) {
                try {
                    this.BTb = this.BTR.readChar();
                } catch (IOException e) {
                }
            }
            return i2;
        }
    }

    private final int ny(int i, int i2) {
        int i3 = 0;
        this.BTe = 3;
        int i4 = 1;
        this.BSX[0] = 0;
        int i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
        while (true) {
            int i6 = this.BTf + 1;
            this.BTf = i6;
            if (i6 == Integer.MAX_VALUE) {
                gUB();
            }
            if (this.BTb < '@') {
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if (i5 > 45) {
                                i5 = 45;
                                continue;
                            } else {
                                continue;
                            }
                        case 1:
                            if (i5 > 42) {
                                i5 = 42;
                                continue;
                            } else {
                                continue;
                            }
                    }
                } while (i4 != i3);
            } else if (this.BTb < 128) {
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if (i5 > 45) {
                                i5 = 45;
                            }
                            if (this.BTb == '\\') {
                                int[] iArr = this.BSX;
                                int i7 = this.BTe;
                                this.BTe = i7 + 1;
                                iArr[i7] = 1;
                                continue;
                            } else {
                                continue;
                            }
                        case 1:
                            if (i5 > 42) {
                                i5 = 42;
                                continue;
                            } else {
                                continue;
                            }
                        case 2:
                            if (i5 > 45) {
                                i5 = 45;
                                continue;
                            } else {
                                continue;
                            }
                    }
                } while (i4 != i3);
            } else {
                int i8 = (this.BTb & 255) >> 6;
                long j = 1 << (this.BTb & '?');
                do {
                    i4--;
                    switch (this.BSX[i4]) {
                        case 0:
                            if ((BSM[i8] & j) != 0 && i5 > 45) {
                                i5 = 45;
                                continue;
                            }
                        case 1:
                            if ((BSM[i8] & j) != 0 && i5 > 42) {
                                i5 = 42;
                                continue;
                            }
                    }
                } while (i4 != i3);
            }
            if (i5 != Integer.MAX_VALUE) {
                this.BTh = i5;
                this.BTg = i2;
                i5 = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
            }
            i2++;
            i4 = this.BTe;
            this.BTe = i3;
            i3 = 3 - i3;
            if (i4 != i3) {
                try {
                    this.BTb = this.BTR.readChar();
                } catch (IOException e) {
                }
            }
            return i2;
        }
    }

    public final aadl gUM() {
        int nu;
        int i;
        int nu2;
        int eA;
        boolean z;
        aadl aadl;
        String str = null;
        int i2 = 0;
        aadl aadl2 = null;
        while (true) {
            try {
                aadk aadk = this.BTR;
                aadk.BTm = -1;
                char readChar = aadk.readChar();
                aadk.BTm = aadk.BTn;
                this.BTb = readChar;
                this.BSY = null;
                this.BSZ = 0;
                while (true) {
                    switch (this.BTc) {
                        case 0:
                            this.BTh = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
                            this.BTg = 0;
                            switch (this.BTb) {
                                case '\n':
                                    eA = nu(0, 2);
                                    break;
                                case '\r':
                                    eA = nu(0, 1);
                                    break;
                                case '(':
                                    eA = nu(0, 37);
                                    break;
                                case ',':
                                    eA = nu(0, 3);
                                    break;
                                case ':':
                                    eA = nu(0, 23);
                                    break;
                                case 'A':
                                    eA = eA(278528);
                                    break;
                                case 'C':
                                    eA = eA(1610612736);
                                    break;
                                case 'D':
                                    eA = eA(4194304);
                                    break;
                                case 'E':
                                    eA = eA(402653184);
                                    break;
                                case 'F':
                                    eA = eA(4352);
                                    break;
                                case 'G':
                                    eA = eA(67108864);
                                    break;
                                case 'J':
                                    eA = eA(198656);
                                    break;
                                case 'M':
                                    eA = eA(6442491920L);
                                    break;
                                case 'N':
                                    eA = eA(PlaybackStateCompat.ACTION_SET_SHUFFLE_MODE);
                                    break;
                                case 'O':
                                    eA = eA(PlaybackStateCompat.ACTION_SET_CAPTIONING_ENABLED);
                                    break;
                                case 'P':
                                    eA = eA(25769803776L);
                                    break;
                                case 'S':
                                    eA = eA(525824);
                                    break;
                                case 'T':
                                    eA = eA(160);
                                    break;
                                case 'U':
                                    eA = eA(33554432);
                                    break;
                                case 'W':
                                    eA = eA(64);
                                    break;
                                default:
                                    eA = nv(0, 0);
                                    break;
                            }
                            i = eA;
                            break;
                        case 1:
                            this.BTh = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
                            this.BTg = 0;
                            switch (this.BTb) {
                                case '(':
                                    nu2 = nu(0, 40);
                                    break;
                                case ')':
                                    nu2 = nu(0, 38);
                                    break;
                                default:
                                    nu2 = nw(0, 0);
                                    break;
                            }
                            i = nu2;
                            break;
                        case 2:
                            this.BTh = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
                            this.BTg = 0;
                            switch (this.BTb) {
                                case '(':
                                    nu = nu(0, 43);
                                    break;
                                case ')':
                                    nu = nu(0, 44);
                                    break;
                                default:
                                    nu = ny(0, 0);
                                    break;
                            }
                            i = nu;
                            break;
                        default:
                            i = i2;
                            break;
                    }
                    if (this.BTh != Integer.MAX_VALUE) {
                        if (this.BTg + 1 < i) {
                            this.BTR.axr((i - this.BTg) - 1);
                        }
                        if ((BSR[this.BTh >> 6] & (1 << (this.BTh & 63))) != 0) {
                            aadl gUL = gUL();
                            gUL.BTU = aadl2;
                            if (BSQ[this.BTh] == -1) {
                                return gUL;
                            }
                            this.BTc = BSQ[this.BTh];
                            return gUL;
                        } else if ((BSS[this.BTh >> 6] & (1 << (this.BTh & 63))) != 0) {
                            if ((BST[this.BTh >> 6] & (1 << (this.BTh & 63))) != 0) {
                                aadl = gUL();
                                if (aadl2 != null) {
                                    aadl.BTU = aadl2;
                                    aadl2.BTT = aadl;
                                }
                            } else {
                                aadl = aadl2;
                            }
                            if (BSQ[this.BTh] != -1) {
                                this.BTc = BSQ[this.BTh];
                                aadl2 = aadl;
                                i2 = i;
                            } else {
                                aadl2 = aadl;
                                i2 = i;
                            }
                        } else {
                            int i3 = this.BSZ;
                            int i4 = this.BTg + 1;
                            this.BTa = i4;
                            this.BSZ = i3 + i4;
                            switch (this.BTh) {
                                case 39:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BTR.axs(this.BSZ));
                                    this.BSZ = 0;
                                    this.BSY.deleteCharAt(this.BSY.length() - 2);
                                    break;
                                case 40:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BTR.axs(this.BSZ));
                                    this.BSZ = 0;
                                    BSK = 1;
                                    break;
                                case 42:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BTR.axs(this.BSZ));
                                    this.BSZ = 0;
                                    this.BSY.deleteCharAt(this.BSY.length() - 2);
                                    break;
                                case 43:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BTR.axs(this.BSZ));
                                    this.BSZ = 0;
                                    BSK++;
                                    break;
                                case 44:
                                    if (this.BSY == null) {
                                        this.BSY = new StringBuffer();
                                    }
                                    this.BSY.append(this.BTR.axs(this.BSZ));
                                    this.BSZ = 0;
                                    int i5 = BSK - 1;
                                    BSK = i5;
                                    if (i5 == 0) {
                                        axq(1);
                                        break;
                                    }
                                    break;
                            }
                            if (BSQ[this.BTh] != -1) {
                                this.BTc = BSQ[this.BTh];
                            }
                            this.BTh = MoPubNativeAdPositioning.MoPubClientPositioning.NO_REPEAT;
                            try {
                                this.BTb = this.BTR.readChar();
                                i2 = 0;
                            } catch (IOException e) {
                                i = 0;
                            }
                        }
                    }
                }
            } catch (IOException e2) {
                this.BTh = 0;
                aadl gUL2 = gUL();
                gUL2.BTU = aadl2;
                return gUL2;
            }
        }
        int gUF = this.BTR.gUF();
        int gUE = this.BTR.gUE();
        try {
            this.BTR.readChar();
            this.BTR.axr(1);
            z = false;
        } catch (IOException e3) {
            String gUI = i <= 1 ? "" : this.BTR.gUI();
            if (this.BTb == '\n' || this.BTb == '\r') {
                gUF++;
                z = true;
                str = gUI;
                gUE = 0;
            } else {
                gUE++;
                z = true;
                str = gUI;
            }
        }
        if (!z) {
            this.BTR.axr(1);
            str = i <= 1 ? "" : this.BTR.gUI();
        }
        throw new aadm(z, this.BTc, gUF, gUE, str, this.BTb, 0);
    }
}